package com.rede.didiok.common.enums;

/**
 * 通知动作类型枚举类
 *
 * @author: 陌溪
 * @date: 2021年8月8日15:26:43
 */
public enum BusinessTypeEnum {

    /**
     * 博客评论
     */
    RANK_MEMBER_COMMENT(1, "博客评论"),

    /**
     * 博客回复
     */
    RANK_MEMBER_REPLY(3, "榜单成员回复"),

    /**
     * 用户关注
     */
    USER_WATCH(5, "用户关注"),

    /**
     * 博客点赞
     */
    RANK_MEMBER_PRAISE(6, "博客点赞"),

    /**
     * 博客
     */
    RANK_MEMBER(8, "榜单成员"),

    /**
     * 留言板回复
     */
    MESSAGE_BOARD_REPLY(10, "留言板回复"),

    /**
     * 关于我回复
     */
    ABOUT_ME_REPLY(11, "关于我回复"),

    /**
     * 用户动态评论
     */
    USER_MOMENT_COMMENT(12, "用户动态评论"),

    /**
     * 用户动态回复
     */
    USER_MOMENT_REPLY(13, "用户动态回复"),

    /**
     * 用户动态点赞
     */
    MOMENT_PRAISE(14, "用户动态点赞"),

    /**
     * 评论点赞
     */
    MEMBER_COMMENT_PRAISE(17, "评论点赞"),

    MOMENT_COMMENT_PRAISE(18, "评论点赞"),

    /**
     * 点赞实体类
     */
    PRAISE(20, "点赞"),

    /**
     * 收藏
     */
    COLLECT(21, "收藏"),

    /**
     * 点击动态
     */
    MOMENT(22, "动态"),


    RANK_MEMBER_COLLECT(27, "文章收藏"),
    MEMBER_COMMENT_COLLECT(30, "评论收藏"),
    MOMENT_COMMENT_COLLECT(31, "评论收藏"),
    MOMENT_COLLECT(32, "动态收藏"),

    RANK_MEMBER_AUDIT(40, "文章审核"),
    MEMBER_COMMENT_AUDIT(43, "评论审核"),
    MOMENT_COMMENT_AUDIT(43, "评论审核"),
    MOMENT_AUDIT(44, "动态审核"),

    /**
     * 获得签到卡
     */
    SEND_SIGN_IN_CARD(50, "获得签到卡"),

    /**
     * 友情链接
     */
    FRIENDLY_LINK(51, "友情链接"),

    /**
     * 用户反馈
     */
    FEED_BACK(52, "用户反馈"),

    /**
     * 勘误
     */
    GENERAL_EDIT(53, "勘误"),

    /**
     * 点踩
     */
    TREAD(54, "点踩"),
    MEMBER_COMMENT(55, "榜单成员评论"),
    MOMENT_COMMENT(56, "用户动态评论"),

    /**
     * 被AT
     */

    BLOG_AT_USER(60, "文章AT"),
    QUESTION_AT_USER(61, "问答AT"),
    PROBLEM_AT_USER(62, "面经AT"),
    COMMENT_AT_USER(63, "评论AT"),
    MOMENT_AT_USER(64, "动态AT"),
    MOMENT_COMMENT_AT_USER(66, "动态评论AT"),
    CHAT_AT_USER(65, "聊天AT"),

    SUB_ACCOUNT(66, "资金分账"),
    WITHDRAW(67, "用户提现"),
    WITHDRAW_FAIL(68, "提现失败"),
    LUCKY(69, "转盘抽奖"),

    ORDER_PLAY_NOTICE(71, "活动玩家报名"),
    ORDER_LEADER_NOTICE(72, "活动领队报名"),
    ORDER_PLAY_CANCEL_NOTICE(73, "活动玩家取消报名"),
    ORDER_LEADER_CANCEL_NOTICE(74, "活动领队取消报名"),
    MY_ORDER_PLAY_CANCEL_NOTICE(75, "我的玩家报名被取消"),
    MY_ORDER_LEADER_CANCEL_NOTICE(76, "我的领队报名被取消"),
    ;


    private final Integer code;
    private final String name;

    BusinessTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static BusinessTypeEnum getType(String resource) {
        for (BusinessTypeEnum type : BusinessTypeEnum.values()) {
            if (type.getCode().equals(Integer.valueOf(resource))) {
                return type;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
